import Vue from 'vue'
import Router from 'vue-router'
import Main from '@/pages/main/main'
import Talking from '@/pages/talking/talking'
import Login from '@/pages/login/login'
import FriendCircle from '@/pages/friendCircle/friendCircle'
import CircleText from '@/pages/friendCircle/circleText'

Vue.use(Router)

export default new Router({
  routes: [
    //登录
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/',
      name: 'chat',
      component: Main,
      redirect: "/chat/chat",
    },
    {
      path: "/chat",
      name: "chat",
      component: Main,
      redirect: "/chat/chat",
      children: [
        {
          path: "chat",
          name: "chat",
          component: () => import('@/pages/chat/chat'),
          meta: { pageTitle: "微信", showPageTitle: false, needSetRouter: true },
        }
      ]
    },
    {
      path: "/address",
      name: "address",
      component: Main,
      redirect: "/address/address",
      children: [
        {
          path: "address",
          name: "address",
          component: () => import('@/pages/address/address'),
          meta: { pageTitle: "联系人", showPageTitle: false, needSetRouter: true },
        }
      ]
    },
    {
      path: "/found",
      name: "found",
      component: Main,
      redirect: "/found/found",
      children: [
        {
          path: "found",
          name: "found",
          component: () => import('@/pages/found/found'),
          meta: { pageTitle: "发现", showPageTitle: false, needSetRouter: true },
        }
      ]
    },
    {
      path: "/mine",
      name: "mine",
      component: Main,
      redirect: "/mine/mine",
      children: [
        {
          path: "mine",
          name: "mine",
          component: () => import('@/pages/mine/mine'),
          meta: { pageTitle: "我的", showPageTitle: false, needSetRouter: true },
        }
      ]
    },
    //聊天对话框
    {
      path: '/talking',
      name: 'talking',
      component: Talking,
    },
    //朋友圈
    {
      path: "/friendCircle",
      name: "friendCircle",
      component: FriendCircle,
    },
    //发表朋友圈
    {
      path: "/circleText",
      name: "circleText",
      component: CircleText,
    },
  ]
})
